<template>
    <div class="profile">
        <h2>个人资料</h2>
        <p>用户名: {{ user.username }}</p>
        
        <div class="test-screenshots">
            <h3>自动化测试结果</h3>
            <img src="../assets/test.png" alt="测试截图">
            <p>测试覆盖率: 85%</p>
        </div>
        
        <button @click="logout">退出登录</button>
    </div>
</template>

<script>
export default {
    computed: {
        user() {
            return this.$store.state.auth.user || { username: '未知用户' }
        }
    },
    methods: {
        logout() {
            this.$store.commit('logout')
            this.$router.push('/login')
        }
    }
}
</script>

<style scoped>
.profile {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}
.test-screenshots {
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #eee;
}
.test-screenshots img {
    max-width: 100%;
    margin-top: 10px;
}
</style>